<template>
  <div>
    <el-scrollbar>
      <el-table v-loading="loading" :header-cell-style="{background:'#eef1f6',color:'#606266'}" border
                :row-style="{height: '54.7px'}"
                style="font-size: 15px" stripe :data="tableData">
        <el-table-column prop="id" label="编号" width="auto"/>
        <el-table-column prop="name" label="学院" width="auto"/>
        <el-table-column prop="totalRank" label="总排名" width="auto"/>
        <el-table-column prop="totalPoints" label="总积分" width="auto"/>
        <el-table-column prop="leader" label="指导老师" width="auto"/>
      </el-table>
    </el-scrollbar>
  </div>
</template>

<script lang="ts" setup>
import {onMounted, reactive, ref, watch} from "vue";

import {
    getMyCollegeInfoApi
} from "@/api/athlete";
import {ElMessage} from "element-plus";


//数据初始化
onMounted(() => {
  getTableData()
})

const tableData = ref([] as any)
const loading = ref(true)

function getTableData() {
  getMyCollegeInfoApi().then((response: any) => {
    console.log(response)
    if (response.code === 200) {
      tableData.value.push(response.data)
    } else {
      ElMessage.warning(response.msg)
    }
    loading.value = false
  })

}


</script>
